package com.example.workbench.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;

import java.time.LocalDateTime;


@Data
@EqualsAndHashCode(callSuper = true)
public class BaseEntity extends BaseEntityIdField {
    @TableField(
            value = "create_time",
            jdbcType = JdbcType.TIMESTAMP,
            fill = FieldFill.INSERT
    )
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime createTime;

//    @TableField(
//            value = "update_time",
//            jdbcType = JdbcType.TIMESTAMP,
//            fill = FieldFill.INSERT_UPDATE
//    )
//    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
//    protected LocalDateTime updateTime;

    @TableField(value = "is_delete")
    @TableLogic(value = "0",delval = "1")
    protected int isDelete;
}
